<template>
  <el-button
    type="primary"
    plain
    size="mini"
    style="margin-bottom: 5px"
    :disabled="item.disabled||false"
    @click="handleClick"
  >{{ item.name }}
  </el-button>
</template>

<script>

import base from '../mixin/base'

export default {
  name: 'HeyTableElButtonTask',
  components: {},
  mixins: [base],
  computed: {},
  created() {
    const operateParam__ = {
      isValid: false
    }
    this.setParam({ ...this.operateParam_, ...operateParam__, ...this.operateParam, ...this.item.operateParam }, true)
  },
  mounted() {

  },
  methods: {
    genParam() {
      const { operateParam_ } = this
      const { param = {}} = operateParam_
      const { task_cal, task_type, task_date } = param
      return {
        task_cal,
        task_type,
        task_date
      }
    },
    canOpen() {
      const { selected, item } = this
      const { selectType } = item
      return this.isSelected(selected, selectType)
    },
    operate() {
      const param = this.genParam()
      console.log('请求参数为：', param)
      if (!this.canOpen() || !this.validate()) {
        return
      }

      this.$router.push({
        name: 'TaskProcessingQuery',
        params: param,
        query: param
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
